import request from "@/utils/request";
import { GEN_SERVER } from "@/config/baseUrl";

// 查询元指标数据列表
export function getIndexList(data) {
  return request({
    url: GEN_SERVER["index-server"] + "/def/indexMeta/list",
    method: "post",
    data: data,
  });
}

// 新增/编辑元指标
export function saveIndex(data) {
  return request({
    url: GEN_SERVER["index-server"] + "/def/indexMeta/addOrUpdate",
    method: "post",
    data: data,
  });
}

// 查询元指标详情
export function getIndexDetail(id) {
  return request({
    url: GEN_SERVER["index-server"] + "/def/indexMeta/detail",
    method: "get",
    params: { id },
  });
}

// 禁用元指标
export function disableIndex(params) {
  return request({
    url: GEN_SERVER["index-server"] + "/def/indexMeta/disableOrEnable",
    method: "post",
    params,
  });
}
